package com.spn.blog.api.controller.system;

import com.spn.blog.api.service.SystemService;
import com.spn.blog.common.vo.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@Api(tags = "系统模块")
@RequestMapping("api/")
public class SystemInfoController {

    @Autowired
    private SystemService systemService;

    /**
     *
     * @return 系统信息（cpu、内存使用等）
     */
    @ApiOperation(value = "获取系统信息")
    @PostMapping("systeminfo")
    @PreAuthorize("hasAuthority('dev:system')")
    public Result systeminfo(){
        return systemService.systeminfo();
    }
}
